<fieldset>
  <legend>Flowdock</legend>
  <p class=></p>

  <%
    stage = form.object
    stage.flowdock_flows.build if stage.flowdock_flows.last&.new_record?
    description = [
      'Name and API token of the Flowdock flow which should be notified of deploys.',
      { class: 'col-lg-offset-2' }
    ]
  %>

  <%= form.fields_for_many :flowdock_flows, description do |flow_field| %>
    <div class="col-lg-2 col-lg-offset-2">
      <%= flow_field.text_field :name, class: "form-control", placeholder: "Flow name" %>
    </div>
    <div class="col-lg-4">
      <%= flow_field.text_field :token, class: "form-control", placeholder: "Token" %>
    </div>
  <% end %>
</fieldset>
